

{include file='common/header.html'}
<!-- 内容主体区域 -->
<div class="layui-body">
  <!--        <div style="padding: 15px;"><h1 style="font-weight: 700">欢迎界面</h1></div>-->
  <div id="user_container" style="padding: 15px;">
    <!--            面包屑导航-->
    <span class="layui-breadcrumb">
              <a href="#" style="font-weight: 700;color: #000!important;">首页</a>
              <a href="#" style="font-weight: 700;color: #000!important;">图书管理</a>
              <a href="" >权限管理</a>
            </span>
    <div class="layui-row layui-col-space15" style="margin-top: 15px">
      <div class="layui-col-md12">
        <div class="layui-panel" style="padding: 20px">
          <table lay-filter="bookListTable"  class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
        </div>
      </div>
    </div>
  </div>
</div>
</div>



<!--状态模板字符-->
<script type="text/html" id="currentTableBar">
  <a class="layui-btn layui-btn-normal layui-btn-sm data-count-edit" lay-event="edit"> <i class="layui-icon layui-icon-edit"></i></a>
  <a class="layui-btn layui-btn-sm layui-btn-danger data-count-delete" lay-event="delete"><i class="layui-icon layui-icon-delete"></i></a>
</script>


<script>
  document.querySelector('.layui-nav-itemed').classList.remove('layui-nav-itemed');
  $('a[href$=rights]').parent()[0].classList.add('layui-this');
  $('a[href$=rights]').parent().parent().parent()[0].classList.add('layui-nav-itemed');

  var formhorizontal  = document.querySelector('.form-horizontal')
  var sureBtn = document.getElementById('sureBtn');
  layui.use(['form', 'table'], function () {
    var $ = layui.jquery,
            form = layui.form,
            table = layui.table;



    // 渲染表格
    table.render({
      elem: '#currentTableId',
      limit:20
      ,url: "{:url('/admins/rights/article')}" //数据接口
      ,page: true //开启分页
      ,limits:[10,20,30]
      ,skin: 'row,line'
      ,id:'bookTable'
      ,cols: [[ //表头
        // {type: "checkbox", },
        {type:"numbers",title: "#"},
        {field: 'role',align:"center", title: '角色'},
        {field: 'rights_name',align:"center", title: '权限名称'},
        {field: 'role',align:"center", title: '权限等级',templet:function (d) {
            if (d.role==="超级管理员")
                return `<button type="button" class="layui-btn-sm layui-btn-primary layui-border-blue">一级</button>`
            return `<button type="button" class="layui-btn-sm layui-btn-primary layui-border-orange">一级</button>`

        }},
      ]],

    });


  });




</script>


{include file='common/footer.html'}
